package postwp.controller;

import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import data.Data;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ListDomainServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		DBCollection collection = Data.data("domaincraw");
		DBCursor cursor = collection.find().limit(100);
		req.setAttribute("cursor", cursor);
		try {
			req.getRequestDispatcher("/list_domain.jsp").forward(req, resp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}